import React from 'react';
import { renderRoutes } from 'react-router-config';
import { NavLink } from 'react-router-dom';
import { LogoHeader } from '../../components/Header';
import CarouselBox from './components/Carousel';
import SearchBox from './components/SearchBox';
import Nav from './Nav';
import Message from './components/Message';

import styles from './index.module.less';

import img1 from '../../asset/images/new/img1.png';
import img2 from '../../asset/images/new/img2.png';

export default class News extends React.Component {
  render() {
    const extra = (
      <React.Fragment>
        <button className={styles.publishPriceBtn}>发布询价单</button>
        <button className={styles.publishGoodsBtn}>发布商品</button>
      </React.Fragment>
    );
    return (
      <div>
        <LogoHeader moduleName='资讯中心' rightContent={<SearchBox />} extra={extra}/>
        <div className={styles.line}></div>
        <div className={styles.content}>
          <div className={styles.clearfix}></div>
          <div className={styles.box1 + ' ' + styles.pullLeft}>
            <React.Fragment>
              <div className={styles.headerBox}>
                <div className={styles.banner + ' ' + styles.pullLeft}>
                  <CarouselBox/>
                </div>
                <div className={styles.imgBox + ' ' + styles.pullRight}>
                  <div className={styles.imgBox1}>
                    <img src={img1} alt=""/>
                    <div className={styles.imgText1} >回收重金属家电</div>
                  </div>
                  <div className={styles.imgBox2}>
                    <img src={img2} alt=""/>
                    <div className={styles.imgText2} >我们致力于使地球变的更绿</div>
                  </div>
                </div>
                <div className={styles.clearfix}></div>
              </div>
              <Nav/>
            </React.Fragment>
            {renderRoutes(this.props.route.routes)}
          </div>
          <div className={styles.box2 + ' ' + styles.pullRight}>
            <Message/>
          </div>
          <div className={styles.clearfix}></div>
        </div>
      </div>
    );
  }
}
